/* 
 * File:   string.c
 * Author: bjorn
 *
 * Created on September 3, 2007, 9:01 PM
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "rope.h"


/*
Rope_class rope_make_join_class(const Rope_class self, const Rope_class other) {
    Rope_class * result = new Rope_class("");;
	result = self + other
    return result;
}
*/
/*
Rope rope_make_join(const Rope self, const Rope other) {
    Rope result;
	(*result) = (*self) + (*other);
	 result->append(self);   result->append(other);
    return result;
}
*/

/*



Rope rope_cat(Rope self, const Rope other) {
    bconcat(self, other);
    return self;
}


Rope rope_format(const char * fmt, ...) {
    int status;
    Rope result = rope_make("");
    bvformata(status, result, fmt, fmt);
    if (BSTR_OK == status) { return result; }
    rope_free(result);
    return NULL;
}


Ropelist ropelist_free(Ropelist self) {
    bstrListDestroy(self);
    return NULL;
}

Ropelist ropelist_make(int size) {
    Ropelist result   = bstrListCreate();
    int status          = bstrListAllocMin (result, size);   
    if( status == BSTR_OK) return result;
    ropelist_free(result);
    return NULL;
}

Ropelist rope_split_c(const Rope self, unsigned char splitchar) {
    return bsplit(self, splitchar);
}

Ropelist rope_split(const Rope self, const Rope splitstring) {
    return bsplitstr(self, splitstring);
}

Ropelist rope_split_any(const Rope self, const Rope splitstring) {
    return bsplits(self, splitstring);
}

size_t ropelist_size(Ropelist self) {
	return self->qty;
}

Rope ropelist_get(const Ropelist self, int index) {
    if(index >= self->qty) return NULL;
    return self->entry[index];    
}

Rope ropelist_set(const Ropelist self, int index, Rope value) {
    if(index >= self->qty) return NULL;
    return self->entry[index] = value;    
}

*/

